package org.jash.shop2112

import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.alipay.sdk.app.EnvUtils
import com.hyphenate.chat.ChatClient
import com.hyphenate.helpdesk.easeui.UIProvider
import com.tencent.mmkv.MMKV
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class App:Application() {
    override fun onCreate() {
        super.onCreate()
        if (BuildConfig.DEBUG) {
            ARouter.openDebug()
            ARouter.openLog()
            EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX)
        }
        ARouter.init(this)
        MMKV.initialize(this)
        val options = ChatClient.Options();
        options.setAppkey("1490240511092785#kefuchannelapp109098")
        options.setTenantId("109098")

// Kefu SDK 初始化
        if (!ChatClient.getInstance().init(this, options)){
            return;
        }
// Kefu EaseUI的初始化
        UIProvider.getInstance().init(this);
    }
}